package com.example.moudlec.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.moudlec.dto.RegistraDto;
import com.example.moudlec.entity.Registration;
import com.example.moudlec.entity.RegistrationDet;
import com.example.moudlec.service.RegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/moudlec/reg")
@SuppressWarnings("all")
public class RegistrationController {

    @Autowired
    RegistrationService service;

    @RequestMapping("/addRegstra")
    public void addRegstra(RegistraDto regdto) {
        service.addRegstra(regdto);
    }

    @RequestMapping("/chkUpReg")
    public void chkUpReg(RegistraDto regdto) {
        service.chkUpReg(regdto);
    }

    @RequestMapping("/checkReglis")
    public IPage<Registration> checkReglis(Long pageNum, Long pageSize) {
        return service.checkReglis(pageNum, pageSize);
    }
}
